<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
    <crudOperation :permission="permission">
      <el-button
        slot="left"
        class="filter-item"
        size="mini"
        type="primary"
        @click="crud.toDetail('wareFeeGoodsEnterDetail')"
      >
        新增
      </el-button>
      <el-button
        slot="left"
        class="filter-item"
        size="mini"
        type="success"
        :disabled="crud.selections.length !== 1"
        @click="crud.toDetail('wareFeeGoodsEnterDetail',crud.selections[0].id)"
      >修改
      </el-button>
<!--      <el-button-->
<!--              slot="right"-->
<!--              class="filter-item"-->
<!--              size="mini"-->
<!--              type="danger"-->
<!--              icon="el-icon-remove-outline"-->
<!--              :loading="enable"-->
<!--              @click="crud.enableOrDisable('DISABLE')"-->
<!--              :disabled="crud.selections.length < 1"-->
<!--              v-permission="permission.pass"-->
<!--      >-->
<!--        审核-->
<!--      </el-button>-->
<!--      <el-button-->
<!--              slot="right"-->
<!--              class="filter-item"-->
<!--              size="mini"-->
<!--              type="success"-->
<!--              icon="el-icon-circle-check"-->
<!--              :loading="able"-->
<!--              :disabled="crud.selections.length < 1"-->
<!--              @click="crud.enableOrDisable('ENABLE')"-->
<!--              v-permission="permission.reject"-->
<!--      >-->
<!--        反审-->
<!--      </el-button>-->
    </crudOperation>
<!--      <vue-context-menu :contextMenuData="contextMenuData"-->
<!--                        @tableConfig="tableConfig"-->
<!--                        @deletedata="deletedata"></vue-context-menu>-->

<!--      &lt;!&ndash; 表格配置 &ndash;&gt;-->
<!--      <el-dialog title="表格配置"-->
<!--                 :visible.sync="tableConfigShow"-->
<!--                 width="60%">-->
<!--        <j-table-column-config :columns.sync="crud.header"  @tabSave="tabSave" @pit="pit" />-->
<!--      </el-dialog>-->
      <div v-if="!crud.props.searchToggle" style="text-align: center">
        <el-form size="small" label-width="70px" v-formkey="{query:toQuery}">
          <el-row :gutter="10">
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="业务日期">
                <div class="flex flex-row">
                  <el-date-picker
                    v-model="query.startTime"
                    align="right"
                    unlink-panels
                    class="fl1"
                    format="yyyy - MM - dd "
                    value-format="yyyy-MM-dd"
                    default-value
                    range-separator=""
                    placeholder="开始日期"
                  />
                  <el-date-picker
                    v-model="query.endTime"
                    align="right"
                    unlink-panels
                    class="fl1"
                    format="yyyy - MM - dd "
                    value-format="yyyy-MM-dd"
                    default-value
                    range-separator=""
                    placeholder="结束日期"
                  />
                </div>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="单据编码">
                <el-input  v-model="query.code"></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="入库仓库">
                <zSelect :value.sync="query.warehouseId"  url="api/dropDown/basWarehouseList"
                         style="width:  100%"/>
              </el-form-item>
            </el-col>
<!--            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">-->
<!--              <el-form-item label="入库类型">-->
<!--                <el-select v-model="query.type" style="width:  100%"  class="edit-input" placeholder="请选择入库类型" >-->
<!--                  <el-option-->
<!--                    v-for="(item,index) in dict.t_ware_other_enter_type"-->
<!--                    :key="index"-->
<!--                    :label="item.label"-->
<!--                    :value="item.value"-->
<!--                  />-->
<!--                </el-select>-->
<!--              </el-form-item>-->
<!--            </el-col>-->
          </el-row>
          <el-row :gutter="10" style="margin-top: 10px">
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="状态">
                <el-select
                  v-model="query.orderStatus"
                  class="filter-item"
                  clearable
                  placeholder="状态"
                  size="small"
                  style="width: 100%"
                  @change="crud.toQuery"
                >
                  <el-option
                    v-for="item in dict.common_order_status"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="部门">
                <zSelect :value.sync="query.deptId"   url="api/dropDown/childSysDeptList"
                         style="width:  100%"/>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="人员" prop="userId">
                <zSelect :value.sync="query.userId"  url="api/dropDown/sysUserList" :params="{deptId:query.deptId}"
                         style="width:  100%"/>
              </el-form-item>
            </el-col>
<!--            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">-->
<!--              <el-form-item label="是否打印">-->
<!--                <el-select v-model="query.isPrint"      style="width:  100%" class="edit-input" placeholder="请选择打印状态" >-->
<!--                  <el-option-->
<!--                    v-for="(item,index) in dict.common_yes_or_no"-->
<!--                    :key="index"-->
<!--                    :label="item.label"-->
<!--                    :value="item.value"-->
<!--                  />-->
<!--                </el-select>-->
<!--              </el-form-item>-->
<!--            </el-col>-->
          </el-row>
          <el-row :gutter="10" style="margin-top: 5px">
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="备注">
                <el-input v-model="query.remark" />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="商品名称">
                <el-input v-model="query.goodsName" />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="客户名称">
                <zSelect :value.sync="query.customerId" :showName="query.customerName" url="api/dropDown/basCustomerList" style="width:  100%;"/>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="费用科目" prop="subject">
                <zSelect :value.sync="crud.order.subjectId" :showName="crud.order.subject"
                         :disabled="crud.order.orderStatus==='PASS'" url="api/dropDown/basSubjectList"
                         style="width:  100%"/>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" style="margin-top: 5px">
              <rrOperation :crud="crud"/>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <el-dialog
        title="请选择打印模板"
        :visible.sync="crud.printConfig.pringDialog"
        width="30%"
      >
        <jPrintConfig groupId="wareFeeGoodsEnter"
                      v-if="crud.printConfig.pringDialog"
                      @getPrintId="crud.toPrint"
                      :isPreview="crud.printConfig.isPreview"
        ></jPrintConfig>
      </el-dialog>
      <el-dialog  title="打印预览"
                  destroy-on-close
                  v-dialogDrag
                  close-on-press-escape
                  :visible.sync="showPdf" append-to-body width="50vw">
        <j-pdf :src="pdfSrc" ></j-pdf>
      </el-dialog>
      <vue-context-menu :contextMenuData="contextMenuData"
                        @tableConfig="tableConfig"
                        @deletedata="deletedata"></vue-context-menu>

      <!-- 表格配置 -->
      <el-dialog title="表格配置"
                 :visible.sync="tableConfigShow"
                 width="60%">
        <j-table-column-config :columns.sync="crud.header"  @tabSave="tabSave" @pit="pit" />
      </el-dialog>
      <!--表单组件-->
<!--      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">-->
<!--        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">-->
<!--          <el-form-item label="id">-->
<!--            <el-input v-model="form.id" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="编码">-->
<!--            <el-input v-model="form.code" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="名称">-->
<!--            <el-input v-model="form.name" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="供应商id" prop="customerId">-->
<!--            <el-input v-model="form.customerId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="费用科目id" prop="subjectId">-->
<!--            <el-input v-model="form.subjectId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="费用科目" prop="subjectId">-->
<!--            <el-input v-model="form.subject" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="业务日期">-->
<!--            <el-input v-model="form.busDate" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="来源类型(1:手动新增 2:导入)">-->
<!--            <el-input v-model="form.sourceType" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="来源id">-->
<!--            <el-input v-model="form.sourceId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="来源编码">-->
<!--            <el-input v-model="form.sourceCode" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="流水号">-->
<!--            <el-input v-model="form.serialNumber" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="部门id">-->
<!--            <el-input v-model="form.deptId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="人员id">-->
<!--            <el-input v-model="form.userId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="仓库id" prop="warehouseId">-->
<!--            <el-input v-model="form.warehouseId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="打印次数">-->
<!--            <el-input v-model="form.printCount" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="排序">-->
<!--            <el-input v-model="form.seq" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="单据状态(SAVE:保存 PASS:审核 CLOSE:关闭 INVALID:作废)">-->
<!--            <el-input v-model="form.orderStatus" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="备注">-->
<!--            <el-input v-model="form.remark" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="单据说明">-->
<!--            <el-input v-model="form.orderRemark" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="添加人id">-->
<!--            <el-input v-model="form.createUserId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="添加人编码">-->
<!--            <el-input v-model="form.createUserCode" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="添加人名称">-->
<!--            <el-input v-model="form.createUserName" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="添加时间">-->
<!--            <el-input v-model="form.createTime" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="修改人id">-->
<!--            <el-input v-model="form.updateUserId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="修改人编码">-->
<!--            <el-input v-model="form.updateUserCode" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="修改人名称">-->
<!--            <el-input v-model="form.updateUserName" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="修改时间">-->
<!--            <el-input v-model="form.updateTime" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="审核人id">-->
<!--            <el-input v-model="form.auditUserId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="审核人编码">-->
<!--            <el-input v-model="form.auditUserCode" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="审核人名称">-->
<!--            <el-input v-model="form.auditUserName" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="审核时间">-->
<!--            <el-input v-model="form.auditTime" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="关闭人id">-->
<!--            <el-input v-model="form.closeUserId" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="关闭人编码">-->
<!--            <el-input v-model="form.closeUserCode" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="关闭人名称">-->
<!--            <el-input v-model="form.closeUserName" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="关闭时间">-->
<!--            <el-input v-model="form.closeTime" style="width: 370px;" />-->
<!--          </el-form-item>-->
<!--        </el-form>-->
<!--        <div slot="footer" class="dialog-footer">-->
<!--          <el-button type="text" @click="crud.cancelCU">取消</el-button>-->
<!--          <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>-->
<!--        </div>-->
<!--      </el-dialog>-->
      <!--表格渲染-->

      <el-table ref="table" stripe border
                height="700"
                show-summary
                v-if="isShowTable"
                @header-dragend="changeColWidth"
                @contextmenu.native="showMenu"
                @cell-dblclick="row=>crud.toEdit(row)"
                v-loading="crud.loading"
                :data="crud.data"
                size="small"
                style="width: 100%;"
                :summary-method="crud.sumRow"
                @row-click="crud.selectRow"
                :row-style="crud.rowClass"
                :row-class-name="crud.tableRowClassName"
                @row-dblclick="crud.toDetailPlus('wareFeeGoodsEnterDetail',$event.id)"
                @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column type="index" width="55" label="序号"/>
        <el-table-column
          v-if="item.visible"
          v-for="(item, index) in crud.header"
          :key="`col_${index}`"
          :prop="item.prop"
          :label="columnLabel(item)"
          :width="item.width + 'px'"
          :data-porp='item.prop'
          @contextmenu.native="showMenu"
          @header-dragend="changeColWidth"
        >
          <!-- 自定义渲染模版 -->
          <template slot-scope="scope">
            <!-- 当列key为 sort 时，渲染一个手柄icon -->
            <template v-if="item.prop =='sort'">
              <div class="handle_move">
                <i :class="scope.row['sort']" />
              </div>
            </template>
            <template v-else>
              <span v-if="item.type == 1" style="margin-left: 10px">{{scope.row[`${item.prop}`]}}</span>
              <span v-if="item.type == 2" style="margin-left: 10px">{{ parseTime(scope.row[`${item.prop}`])}}</span>
              <span v-if="item.type == 3" style="margin-left: 10px">{{ getDict(`this.dict.label.${item.dictionary}["${scope.row[item.prop]}"]`) }}</span>
            </template>
          </template>
        </el-table-column>
<!--        <el-table-column v-if="columns.visible('id')" prop="id" label="id" />-->
<!--        <el-table-column v-if="columns.visible('code')" prop="code" label="编码" />-->
<!--        <el-table-column v-if="columns.visible('name')" prop="name" label="名称" />-->
<!--        <el-table-column v-if="columns.visible('customerId')" prop="customerId" label="供应商id" />-->
<!--        <el-table-column v-if="columns.visible('subjectId')" prop="subjectId" label="费用科目id" />-->
<!--        <el-table-column v-if="columns.visible('busDate')" prop="busDate" label="业务日期">-->
<!--          <template slot-scope="scope">-->
<!--            <span>{{ parseTime(scope.row.busDate) }}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column v-if="columns.visible('sourceType')" prop="sourceType" label="来源类型" />-->
<!--        <el-table-column v-if="columns.visible('sourceId')" prop="sourceId" label="来源id" />-->
<!--        <el-table-column v-if="columns.visible('sourceCode')" prop="sourceCode" label="来源编码" />-->
<!--        <el-table-column v-if="columns.visible('serialNumber')" prop="serialNumber" label="流水号" />-->
<!--        <el-table-column v-if="columns.visible('deptId')" prop="deptId" label="部门id" />-->
<!--        <el-table-column v-if="columns.visible('userId')" prop="userId" label="人员id" />-->
<!--        <el-table-column v-if="columns.visible('warehouseId')" prop="warehouseId" label="仓库id" />-->
<!--        <el-table-column v-if="columns.visible('printCount')" prop="printCount" label="打印次数" />-->
<!--        <el-table-column v-if="columns.visible('seq')" prop="seq" label="排序" />-->
<!--        <el-table-column v-if="columns.visible('orderStatus')" prop="orderStatus" label="单据状态" />-->
<!--        <el-table-column v-if="columns.visible('remark')" prop="remark" label="备注" />-->
<!--        <el-table-column v-if="columns.visible('orderRemark')" prop="orderRemark" label="单据说明" />-->
<!--        <el-table-column v-if="columns.visible('createUserId')" prop="createUserId" label="添加人id" />-->
<!--        <el-table-column v-if="columns.visible('createUserCode')" prop="createUserCode" label="添加人编码" />-->
<!--        <el-table-column v-if="columns.visible('createUserName')" prop="createUserName" label="添加人名称" />-->
<!--        <el-table-column v-if="columns.visible('createTime')" prop="createTime" label="添加时间">-->
<!--          <template slot-scope="scope">-->
<!--            <span>{{ parseTime(scope.row.createTime) }}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column v-if="columns.visible('updateUserId')" prop="updateUserId" label="修改人id" />-->
<!--        <el-table-column v-if="columns.visible('updateUserCode')" prop="updateUserCode" label="修改人编码" />-->
<!--        <el-table-column v-if="columns.visible('updateUserName')" prop="updateUserName" label="修改人名称" />-->
<!--        <el-table-column v-if="columns.visible('updateTime')" prop="updateTime" label="修改时间">-->
<!--          <template slot-scope="scope">-->
<!--            <span>{{ parseTime(scope.row.updateTime) }}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column v-if="columns.visible('auditUserId')" prop="auditUserId" label="审核人id" />-->
<!--        <el-table-column v-if="columns.visible('auditUserCode')" prop="auditUserCode" label="审核人编码" />-->
<!--        <el-table-column v-if="columns.visible('auditUserName')" prop="auditUserName" label="审核人名称" />-->
<!--        <el-table-column v-if="columns.visible('auditTime')" prop="auditTime" label="审核时间">-->
<!--          <template slot-scope="scope">-->
<!--            <span>{{ parseTime(scope.row.auditTime) }}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column v-if="columns.visible('closeUserId')" prop="closeUserId" label="关闭人id" />-->
<!--        <el-table-column v-if="columns.visible('closeUserCode')" prop="closeUserCode" label="关闭人编码" />-->
<!--        <el-table-column v-if="columns.visible('closeUserName')" prop="closeUserName" label="关闭人名称" />-->
<!--        <el-table-column v-if="columns.visible('closeTime')" prop="closeTime" label="关闭时间">-->
<!--          <template slot-scope="scope">-->
<!--            <span>{{ parseTime(scope.row.closeTime) }}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column v-permission="['admin','wareFeeGoodsEnter:edit','wareFeeGoodsEnter:del']" label="操作" width="150px" align="center">-->
<!--          <template slot-scope="scope">-->
<!--            <udOperation-->
<!--              :data="scope.row"-->
<!--              :permission="permission"-->
<!--            />-->
<!--          </template>-->
<!--        </el-table-column>-->
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>

<script>
import crudWareFeeGoodsEnter from '@/api/erp/wareFeeGoodsEnter'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import {salesDetailKey} from "@/utils/key";
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import { publicListKey } from "@/utils/key";
import { getTypeList } from '@/api/erp/basGoodsType'
import { getAreaTree } from '@/api/erp/basCustomerArea'
import {getHeaderProperties} from "@/api/erp/headerProperties";
import {tablemixins} from "@/mixins/tablemixins";
import jPrintConfig from "@/components/jPrintConfig/jPrintConfig";
import  jTableColumnConfig
from "@/components/jTableColumnConfig/jTableColumnConfig";

// crud交由presenter持有
const defaultCrud = CRUD({
  title: '费用商品入库单',
  url: 'api/wareFeeGoodsEnter',
  sort: 'id,desc',
  name:'wareFeeGoodsEnter',
  optShow: {
    add: false,
    edit: false,
    del: true,
    copy: false,
    download: true,
    leadingIn: true,
    enable: false,
    disable: false,
    reject: true,
    pass: true,
    downloadDetail: true,
    printDetail: true,
    print: true,
  }, crudMethod: {...crudWareFeeGoodsEnter}
})
const defaultForm = { id: null, code: null, name: null, customerId: null, subjectId: null, busDate: null, sourceType: null, sourceId: null, sourceCode: null, serialNumber: null, deptId: null, userId: null, warehouseId: null, printCount: null, seq: null, orderStatus: null, remark: null, orderRemark: null, createUserId: null, createUserCode: null, createUserName: null, createTime: null, updateUserId: null, updateUserCode: null, updateUserName: null, updateTime: null, auditUserId: null, auditUserCode: null, auditUserName: null, auditTime: null, closeUserId: null, closeUserCode: null, closeUserName: null, closeTime: null }
export default {
  name: 'WareFeeGoodsEnter',
  components: { pagination, crudOperation, rrOperation, udOperation ,jTableColumnConfig,jPrintConfig},
  mixins: [presenter(defaultCrud), header(), form(defaultForm), crud(),publicListKey, tablemixins ],
  dicts: ['common_yes_or_no','common_order_status','t_ware_other_enter_type','t_ware_other_enter_source_type'],
  data() {
    return {

      permission: {
        add: ['admin', 'wareFeeGoodsEnter:add'],
        edit: ['admin', 'wareFeeGoodsEnter:edit'],
        del: ['admin', 'wareFeeGoodsEnter:del'],
        import: ['admin', 'wareFeeGoodsEnter:import'],
        export: ['admin', 'wareFeeGoodsEnter:export'],
        copy: ['admin', 'wareFeeGoodsEnter:copy'],
        upload: ['admin', 'wareFeeGoodsEnter:upload'],
        download: ['admin', 'wareFeeGoodsEnter:download'],
        pass: ['admin', 'wareFeeGoodsEnter:pass'],
        reject: ['admin', 'wareFeeGoodsEnter:reject'],
        closed: ['admin', 'wareFeeGoodsEnter:closed'],
        invalid: ['admin', 'wareFeeGoodsEnter:invalid'],
        stop: ['admin', 'wareFeeGoodsEnter:stop'],
        recover: ['admin', 'wareFeeGoodsEnter:recover'],
      },
      rules: {
        customerId: [
          { required: true, message: '供应商id不能为空', trigger: 'blur' }
        ],
        subjectId: [
          { required: true, message: '费用科目id不能为空', trigger: 'blur' }
        ],
        warehouseId: [
          { required: true, message: '仓库id不能为空', trigger: 'blur' }
        ]
      }    }
  },
  watch: {
  },
  created() {
    this.getAreaList()
    this.getTypeList()
  },
  methods: {
    // 获取数据前设置好接口地址
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }, // 新增与编辑前做的操作
    [CRUD.HOOK.afterToCU](crud, form) {
    },
    getAreaList() {
      getAreaTree().then(res => {
        this.areaList = res
      })
    },
    getTypeList() {
      getTypeList({page: 0, size: 999}).then(res => {
        this.typeList = res
      })
    },
  }
}
</script>

<style scoped>
  .table-img {
    display: inline-block;
    text-align: center;
    background: #ccc;
    color: #fff;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    vertical-align: middle;
    width: 32px;
    height: 32px;
    line-height: 32px;
  }
</style>
